1. Field of the Invention
The present invention relates to a photoelectric sensor and a method of detecting an object to be detected using the photoelectric sensor. More particularly, the present invention relates to an improvement in signal processing for making it possible to provide high precision while avoiding a saturation phenomenon of a detection value corresponding to the light receiving amount of the photoelectric sensor.
2. Description of the Related Art
A photoelectric sensor, also called a photoelectric switch, has a basic function of sensing whether or not an object to be detected exists in the detection area. The photoelectric sensor comprises a light emitting section, a light receiving section, an amplification circuit, an A/D converter, and a processing section. The light emitting section emits light to the detection area. The light receiving section receives light from the detection area. The amplification circuit amplifies an electric signal corresponding to the light receiving amount output from the light receiving section. The A/D converter converts the output voltage of the amplification circuit into a digital value. The processing section controls the light emitting operation of the light emitting section and processing the digital value provided by the A/D converter.
Light emitted from a light emitting element (LED or laser) of the light emitting section controlled by the processing section is emitted to the detection area. Light passing through the detection area (when the sensor is a transmission photoelectric sensor) or light reflected on the object to be detected (when the sensor is a reflection photoelectric sensor) is received by a light receiving element of the light receiving section and is converted into an electric signal. The electric signal is amplified and shaped in waveform by the amplification circuit and then is converted into a digital value by the A/D converter. The digital value is displayed on a display having a plurality of digit positions using 7-segment LEDs, for example, as a detection value by the processing section. Alternatively, the digital value is compared with a threshold value (setup value), whereby it is output as the detection result of 0 or 1 corresponding to the presence or absence of the object to be detected.
As one of the performance capabilities required for such a photoelectric sensor, a wide dynamic range can be named. That is, it is the performance capability of correctly detecting the light receiving amount from a small light receiving amount to a large light receiving amount. For example, in a reflection photoelectric sensor, if the distance from the photoelectric sensor (light emitting section and light receiving section) to the object to be detected is short under the condition of the same light emitting amount, a large light receiving amount can be provided; if the distance is long, only a small light receiving amount can be provided.
If the light emitting amount is set so that a sufficient light receiving amount can be provided even if the distance is long, it is feared that the light receiving amount may be saturated if the distance is short. If the light amount is set so that a correct detection can be made even if the light receiving amount is small by setting a large amplification ratio of the amplification circuit, it is feared that the amplification circuit or the A/D converter may be saturated if the light receiving amount grows.
On the other hand, if the light emitting amount or the amplification ratio of the amplification circuit is reduced to a low value to avoid saturation of the amplification circuit or the A/D converter, when the distance to the object to be detected is long, a sufficient detection value cannot be provided and it becomes difficult to determine whether or not the object to be detected exists.
To widen the dynamic range while considering such tradeoff relationship between the light receiving sensitivity and saturation, some photoelectric switches in related arts enable the operator to change any of the light emitting amount, the amplification ratio of the amplification circuit, or hysteresis to any one of several steps. For example, the amplification degree is changed to any one of several steps and to display the detection value, a set of the position number of the current amplification degree and the detection value is displayed.
To correctly determine whether or not the object to be detected exists, not only the provided light receiving amount (detection value) needs to be sufficient, but also the change amount of the light receiving amount (detection value) corresponding to the presence or absence of the object to be detected needs to be sufficiently large. If the object to be detected is sufficiently large, it can be expected that the light receiving amount (detection value) when the object to be detected exists will largely change from that when the object to be detected does not exist. However, if the object to be detected is small (or thin), large change cannot be expected. That is, the area of the object to be detected in the emitted light spot diameter, more accurately, the ratio between the light amount contained in the emitted light spot diameter and the light shield amount or the reflected light amount on the object to be detected, which will be hereinafter referred to as light amount ratio, introduces a problem. If the light amount ratio is small, the change amount of the light receiving amount (detection value) corresponding to the presence or absence of the object to be detected reduces and the case where whether or not the object to be detected exists cannot correctly be determined occurs.
To increase the light amount ratio, with the reflection photoelectric sensor, it is effective to shorten the distance from the photoelectric sensor to the object to be detected to the distance at which the emitted light spot diameter does not largely widen. With the transmission photoelectric sensor, likewise, it is effective to shorten the distance between the light emitting section and the light receiving section of the photoelectric sensor so that a large light amount as much as possible arrives at the light receiving section.
However, in either case, the light receiving amount itself grows, causing the problem of saturation of the amplification circuit or the A/D converter as described above to occur. If the light emitting amount or the amplification ratio of the amplification circuit is reduced to a low value to avoid saturation, the change amount of the light receiving amount (detection value) reduces and the detection (determination) capability (namely, resolution) of the presence or absence of a small (or thin) object to be detected is degraded.
To enhance such a resolution, it is possible to increase the number of the bits of the A/D converter (use a high-resolution A/D converter), but the cost of the A/D converter is increased accordingly and it becomes difficult to provide an inexpensive photoelectric sensor.
It is therefore an object of the invention to provide a photoelectric sensor and a method of detecting an object to be detected using the photoelectric sensor that can detect a small object to be detected with high accuracy by shortening the distance between the photoelectric sensor and the object to be detected as a digital value processing method is devised without using a high-resolution A/D converter leading to an increase in costs.
According to the invention, there is provided a photoelectric sensor comprising a light emitting section for emitting light to a detection area, a light receiving section for receiving light from the detection area, an amplification circuit for amplifying an electric signal corresponding to the light receiving amount output from the light receiving section, an A/D converter for converting an output voltage of the amplification circuit into a digital value, and a processing section for controlling the light emitting operation of the light emitting section and processing the digital value provided by the A/D converter, wherein the photoelectric sensor has a high-precision mode wherein the light emitting amount of the light emitting section or the amplification ratio of the amplification circuit is made lower than that in the normal mode, whereby the amplification circuit or the A/D converter is made hard to be saturated, and wherein in the high-precision mode, the processing section causes the light emitting section to perform the light emitting operation a plurality of times successively, adds a plurality of digital values provided by the A/D converter in response to the light emitting operation performed plurality of times, and processes the digital value of the addition result as a detection value corresponding to the light receiving amount.
According to the configuration, when the object to be detected is small (or narrow), if the high-precision mode is selected and the head section of the photoelectric sensor is brought close to the object to be detected as much as possible, the change amount of the light receiving amount (detection value) corresponding to the presence or absence of the object to be detected can be made large as much as possible while saturation of the light receiving amount (detection value) is avoided. Therefore, the presence or absence of the object to be detected can be detected (determined) with good accuracy. The advantage that the detection accuracy against noise (signal-to-noise (S/N) ratio) is enhanced can also be provided.
In a preferred mode, the photoelectric sensor further comprises a display comprising a first display section and a second display section, each consisting of a plurality of digit places, being placed side by side, wherein the processing section displays the detection value in the first display section and uses the second display section to display any other than the detection value in the normal mode and uses the first and second display sections to display the detection value with an increased number of digit places in the high-precision mode. For example, when the first display section and the second display section have each four display digit places, only the four digit places of the first display section are used to display the detection value in the normal mode and the four digit places of the first display section plus the low-order one digit place of the second display section (a maximum of five digits places) are used to display the detection value in the high-precision mode. Of course, if all of the four digit places of the first display section and the four digit places of the second display section are used, the detection value can be displayed using a maximum of eight digit places.
In doing so, the detection value with an increased number of digits in the high-precision mode can be displaced intact, and the user can recognize that the photoelectric sensor operates in the high-precision mode from the number of digits of the displayed detection value. As for threshold value setting, likewise, the threshold value in the high-precision mode with an increased number of digits may be able to be set using the first and second display sections.
In another preferred mode, in the high-precision mode, the processing section sets a threshold value and a shift amount based on the detection value under a predetermined condition, decrements the shift amount from the threshold value and the detection value (for example, each a five-digit value) to provide a threshold value and a detection value with as many digits as reduced to the maximum number of display digits of the detection value in the normal mode (for example, four digits), and displays the threshold value and the detection value on the display as the threshold value and the detection value for display. In doing so, the detection value in the normal mode and the detection value in the high-precision mode can be displayed only with a display having a limited number of digit places.
In still another preferred mode, the photoelectric sensor further comprises a display comprising a first display section and a second display section, each consisting of a plurality of digit places, being placed side by side, wherein the processing section is responsive to a switch signal input for switching a display mode between a first display mode of using both the first and second display sections to display the detection value with an increased number of digit places and a second display mode of using only either of the first and second display sections to display the detection value for display with a reduced number of digit places. This corresponds to a combination of the two modes described above. In doing so, the user can select either display mode in response to the purpose. For example, to use only the first display section to display the detection value for display with a reduced number of digits in the second display mode, the threshold value for display with a reduced number of digits can be displayed in the second display section.
In another configuration of the photoelectric sensor according to the invention, in the high-precision mode, the processing section causes the light emitting section to perform the light emitting operation a plurality of times successively, averages a plurality of digital values provided by the A/D converter in response to the light emitting operation performed plurality of times, and processes the average digital value as a detection value corresponding to the light receiving amount. That is, in the configuration, a plurality of digital values provided by the A/D converter are added and then the addition result is divided by the number of addition times to find an average and the found average is used as the detection value corresponding to the light receiving amount. In the configuration, apparently the number of digits of the detection value does not increase and the user cannot recognize that the photoelectric sensor operates in the high-precision mode, but the advantage that the detection accuracy against noise (signal-to-noise (S/N) ratio) is enhanced as compared with the case where the detection value provided by only one light emitting operation is used can be provided.
In still another configuration of the photoelectric sensor according to the invention, in the high-precision mode, the processing section adds the digital value provided by the A/D converter a plurality of times or multiplies the digital value by an integer to find a value, and processes the found value as a detection value corresponding to the light receiving amount. In this configuration, the advantage that the detection accuracy against noise (signal-to-noise (S/N) ratio) is enhanced cannot be provided, but the advantage that apparently the number of digits of the detection value increases and the user can be made to recognize the high-precision mode can be provided.